#include "stdio.h"
#include "stdlib.h"


int *shuffle(int *nums, int numsSize, int n, int *returnSize) {
    int *res = (int *) malloc(sizeof(int) * (n * 2));
    for (int i = 0; i < n; i++) {
        res[2 * i] = nums[i];
        res[2 * i + 1] = nums[i + n];
    }
    *returnSize = n * 2;
    return res;
}

int main() {
    int a[] = {2, 5, 1, 3, 4, 7};

    int *res = shuffle(a, 6, 3, 0);

    for (int i = 0; i < 6; i++) {
        printf("%d ", res[i]);
    }
    free(res);
}